''' 窗口截图'''
from selenium import webdriver
from time import sleep

# 访问百度
driver = webdriver.Chrome()
driver.get('https://www.baidu.com')
# 搜索
driver.find_element_by_id('kw').send_keys('selenium')
driver.find_element_by_id('su').click()
sleep(2)

# 截取当前窗口，并指定截图图片的保存位置
driver.get_screenshot_as_file('F:/python_pj/selenium-study/baidu_img.png')

driver.quit()